package 栈;

public class 回文 {
    public static void main(String[] args) throws Exception {
        String str="ahahaahaha";
        seqStack se = new seqStack();
        int mid = str.length()/2-1;
        int next=0;
        boolean flg=true;
        for (int i = 0; i <= str.length()/2-1; i++) {
            se.push(str.charAt(i));
        }
        se.print();
        if(str.length()%2==0){
            next=mid+1;
        }else{
            next=mid+2;
        }
        for (int i =next; i <=str.length()-1 ; i++) {
            if(str.charAt(i)!=(char)se.pop()){
                flg=false;
                break;
            }
        }
        System.out.println(flg?"回文":"不是");
    }
}
